package com.chapter10.inner_class.annoyclass;


public class Test1{

    public static void main(String[] args){

        Animal camel = new Animal(){

            public void cry(){
                System.out.println("骆驼叫唤...");

            }
        };
        System.out.println("匿名对象的名称为: " + camel.getClass());
        camel.cry();
    }
}

interface Animal{

    public void cry(); //抽象方法需要重写
}